string_left
This function returns a specified number of characters from the left hand side of a string.
string string_left(string the_string, uint count)
Parameters:
the_string
The string that will be extracted from.
count
The number of characters to return.
Return value:
A string containing the leftmost count characters of the string.
Remarks:
If count is less than 1, a blank string will be returned. Likewise, if count is greater than the string's length, then the whole string will be returned.
Example:
void main()
{
alert("string_left test", string_left("Hello, I am a string!", 5)); //output should be Hello
}